Skip to content

NFC: ExtractIRForPassTest.py: add tool path option and -hlsl-passes-pause#8447

Open
tex3d wants to merge 2 commits into
microsoft:mainfrom
tex3d:extractir-update
Open

NFC: ExtractIRForPassTest.py: add tool path option and -hlsl-passes-pause#8447
tex3d wants to merge 2 commits into
microsoft:mainfrom
tex3d:extractir-update

Conversation

@tex3d
Copy link
Copy Markdown
Contributor

@tex3d tex3d commented May 12, 2026

Adds a -t or --tool-path option for specifying the directory containing dxc and dxopt tools and improves error handling for missing tools.

Also adds -hlsl-passes-pause to the suggested test RUN line after the target pass, since this is needed to update the metadata in the resulting checked IR, when a pass might impact HLModule or DxilModule state.

…ause

Adds a -t or --tool-path option for specifying the directory containing dxc and dxopt tools and improves error handling for missing tools.

Also adds -hlsl-passes-pause to the suggested test RUN line after the target pass, since this is needed to update the metadata in the resulting checked IR, when a pass might impact HLModule or DxilModule state.
Copy link
Copy Markdown
Collaborator

@bob80905 bob80905 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, otherwise looks good to us @alsepkow

Comment thread utils/hct/ExtractIRForPassTest.py Outdated
dxopt_path = os.path.join(args.tool_path, dxopt_path)
if not os.path.isfile(dxc_path) or not os.path.isfile(dxopt_path):
raise FileNotFoundError(
f"dxc not found at {dxc_path}. Use -t to specify path to dxc and dxopt."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error may be raised if dxopt isn't found, couldn't this be clarified with the below error message that you wrote?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is that this one was an explicit tools path, while the other one is the default which searches the PATH for dxc. But now that I look at it, I realize this needs a slight adjustment: it should say dxc or dxopt not found in specified tool path: {args.tool_path}..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed that, plus added tools path directory check first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants